package com.shaozi.nc.data.model;

import org.springframework.data.mongodb.core.mapping.Document;
import com.shaozi.data.mongo.model.ModelBase;
import com.shaozi.utils.common.JsonUtil;

/**
 * 推送模型
 * <p>
 * {@code
 * 
 * 字段名           必须       有效值                      有效字符
秒                 是          0 至 59                         , - * /
分钟               是          0 至 59                         , - * /
小时               是          0 至 23                         , - * /
Day of month       是          1 至 31                         , - * ? / L W
月                 是          1 至 12 或 JAN 至 DEC           , - * /
Day of week        是          1 至 7 或 SUN 至 SAT            , - * ? / L #
年                 否          空，1970 至 2099                , - * /
 * 
 * }
 * </p>
 * 
 * @author brenx
 * 
 */
@Document(collection = "nc_push_msg")
public class PushMsgModel extends ModelBase {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6412691360773254198L;

	/**
	 * 推送时间
	 * 
	 */
	private String pushTimeRegex;
	private Long createTime;
	private String compId;
	/**
	 * 来源的ID
	 */
	private String sourceId;
	private String userId;
	/**
	 * 1: im, 2:oa
	 */
	private Integer sourceType;

	/**
	 * 已循环的次数
	 */
	private Integer repeatCount;
	/**
	 * 循环提示
	 * <p>
	 * 0 : 执行一次，不循环 -1：一直执行
	 */
	private Integer designRepeatCount;
	/**
	 * 间隔时间(s),不间隔设置0或null
	 */
	private Integer intervalTime;
	/**
	 * 下次将要推送的时间
	 */
	private Long nextPushTime;
	/**
	 * 是否记录badge(未读消息数量),
	 */
	private Boolean isBadge;
	/**
	 * 上次推送时间
	 */
	private Long lastPushTime;
	private String title;
	private String content;

	/**
	 * 超过时间不再推送<br>
	 * 0:推送永久有效
	 */
	private Long expireTime;

	private Integer isDel;
	private Long delTime;
	private SubPushMsgModel subModel;
	private String callbackUrl;

	public PushMsgModel() {

	}

	public Long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Long createTime) {
		this.createTime = createTime;
	}

	public Integer getIntervalTime() {
		return intervalTime;
	}

	public void setIntervalTime(Integer intervalTime) {
		this.intervalTime = intervalTime;
	}

	public Long getLastPushTime() {
		return lastPushTime;
	}

	public void setLastPushTime(Long lastPushTime) {
		this.lastPushTime = lastPushTime;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Long getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(Long expireTime) {
		this.expireTime = expireTime;
	}

	public Long getNextPushTime() {
		return nextPushTime;
	}

	public void setNextPushTime(Long nextPushTime) {
		this.nextPushTime = nextPushTime;
	}

	public Integer getIsDel() {
		return isDel;
	}

	public void setIsDel(Integer isDel) {
		this.isDel = isDel;
	}

	public Long getDelTime() {
		return delTime;
	}

	public void setDelTime(Long delTime) {
		this.delTime = delTime;
	}

	public Boolean getIsBadge() {
		return isBadge;
	}

	public void setIsBadge(Boolean isBadge) {
		this.isBadge = isBadge;
	}

	public SubPushMsgModel getSubModel() {
		return subModel;
	}

	public void setSubModel(SubPushMsgModel subModel) {
		this.subModel = subModel;
	}

	public String getPushTimeRegex() {
		return pushTimeRegex;
	}

	public void setPushTimeRegex(String pushTimeRegex) {
		this.pushTimeRegex = pushTimeRegex;
	}

	public Integer getRepeatCount() {
		return repeatCount;
	}

	public void setRepeatCount(Integer repeatCount) {
		this.repeatCount = repeatCount;
	}

	public Integer getDesignRepeatCount() {
		return designRepeatCount;
	}

	public void setDesignRepeatCount(Integer designRepeatCount) {
		this.designRepeatCount = designRepeatCount;
	}

	public Integer getSourceType() {
		return sourceType;
	}

	public void setSourceType(Integer sourceType) {
		this.sourceType = sourceType;
	}

	public String getCallbackUrl() {
		return callbackUrl;
	}

	public void setCallbackUrl(String callbackUrl) {
		this.callbackUrl = callbackUrl;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getSourceId() {
		return sourceId;
	}

	public void setSourceId(String sourceId) {
		this.sourceId = sourceId;
	}

	public String toJsonStr() {
		return JsonUtil.toJsonString(this);
	}

	public String getCompId() {
		return compId;
	}

	public void setCompId(String compId) {
		this.compId = compId;
	}
}
